﻿using System;
using System.Collections.Generic;

using System.Text;

namespace DTO
{
    public class Contact : Person
    {
        #region Fields
        #endregion

        #region Properties
        public ContactType Type { get; set; }
        #endregion

        #region Constructors
        public Contact () : this(0) { }
        public Contact (int id) : base(id)
        {
        }        
        #endregion

        #region Private Methods
        #endregion

        #region Public Methods
        public override string ToString()
        {
            return base.ToString();
        }

        public static Contact MainContactSample ()
        {
            return new Contact()
            {
                FirstName = "Dave",
                LastName = "Bane",
                Location = LocationInfo.Sample(),
                Phone = "214-931-9534",
                Email = "dave.bane@r-t-inc.com"
            };
        }
        public static Contact BillingContact ()
        {
            return new Contact()
            {
                FirstName = "Maria",
                LastName = "Nguyen",
                Location = LocationInfo.Sample()
            };
        }
        public static Contact Sample ()
        {
            return new Contact(10)
            {
                FirstName = "Troy",
                LastName = "Potts",
                Email = "tpotts@pfoglobal.com",
                Location = LocationInfo.Sample(),
                Type = ContactType.Sample(1),
                Phone = "253452345"
            };
        }
        #endregion

        public class ContactType : BaseDTO
        {
            #region Fields
            #endregion

            #region Properties
            public string Name { get; set; }
            #endregion

            #region Constructors
            public ContactType () : this(0) { }
            public ContactType ( int id )
                : base(id)
            {
            }        
            #endregion

            #region Private Methods
            #endregion

            #region Public Methods
            public static ContactType Sample(int index)
            {
                ContactType type = null;

                switch (index)
                {
                    case 1:
                        type = new ContactType() { Name = "Technical" };
                        break;
                    case 2:
                        type = new ContactType() { Name = "Billing" };
                        break;
                    case 3:
                        type = new ContactType() { Name = "Sales" };
                        break;
                    case 4:
                        type = new ContactType() { Name = "All" };
                        break;
                }

                return type;
            }
            public static IList<ContactType> Samples ()
            {
                IList<ContactType> list = new List<ContactType>();
                for ( int i = 1; i < 5; i++ )
                {
                    list.Add(Contact.ContactType.Sample(i));
                }
                return list;
            }
            #endregion
        }
    }
}
